<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:sec="http://www.springframework.org/security/tags"
	xmlns:p="http://primefaces.org/ui">

	<h:form id="form_editingRecipe_edit">
		<div class="row-fluid">
			<div class="span4">
				<p class="lead">Nom</p>
				<p>
					<p:inputText value="#{C_RECIPE.editingRecipe.name}" />
				</p>

			</div>
			<div class="span4">
				<p class="lead">Description</p>
				<p>
					<p:inputTextarea value="#{C_RECIPE.editingRecipe.comment}" />
				</p>
			</div>
			<div class="span4">
				<p class="lead">Collection</p>
				<p>
					<p:selectOneMenu id="collection" value="#{C_RECIPE.editingRecipe.collection.name}">
						<f:selectItems value="#{C_RECIPE.collections}" var="c"
							itemValue="#{c}" itemLabel="#{c.name}"/>
					</p:selectOneMenu>
				</p>
			</div>
		</div>
		<div class="row-fluid">
			<div class="span4">
				<p class="lead">Bases</p>
				<ul class="unstyled">
					<ui:repeat var="ub" value="#{C_RECIPE.editingRecipe.useBases}">
						<li>#{ub.base.comment} #{ub.base.name} <i class="icon-remove" />
						</li>
						<li><h:inputText value="#{ub.concentration}"
								style="display: inline; width: 30px" /> mg/ml - <h:inputText
								value="#{ub.quantity}" style="display: inline; width: 30px" />
							#{ub.unit}</li>
						<hr style="margin-top: 5px; margin-bottom: 5px;" />
					</ui:repeat>
					<i class="icon-plus"></i>
					<p:commandButton styleClass="btn btn-link" value="Ajouter une base"
						ajax="false" />
				</ul>
			</div>
			<div class="span4">
				<p class="lead">Aromes</p>
				<ul class="unstyled">
					<ui:repeat var="ua" value="#{C_RECIPE.editingRecipe.useAromas}">
						<li>#{ua.aroma.name} <h:inputText value="#{ua.quantity}"
								style="display: inline; width: 30px" /> #{ua.unit} <i
							class="icon-remove" />
						</li>
						<hr style="margin-top: 5px; margin-bottom: 5px;" />
					</ui:repeat>
					<i class="icon-plus"></i>
					<p:commandButton styleClass="btn btn-link" value="Ajouter un arôme"
						ajax="false" />
				</ul>
			</div>
			<div class="span4">
				<p class="lead">Additifs</p>
				<ul class="unstyled">
					<ui:repeat var="ud" value="#{C_RECIPE.editingRecipe.useAdditives}">
						<li>#{ud.additive.name} - #{ud.quantity} #{ud.unit}</li>
						<hr style="margin-top: 5px; margin-bottom: 5px;" />
					</ui:repeat>
					<i class="icon-plus"></i>
					<p:commandButton styleClass="btn btn-link"
						value="Ajouter un additif" ajax="false" />
				</ul>
			</div>
		</div>
		<hr />
		<div class="control-group">
			<div class="controls">
				<h:commandButton styleClass="btn btn-mini btn-primary"
					action="#{C_RECIPE.saveRecipe}" value="Enregistrer" />
				<h:link styleClass="btn btn-mini" style="margin-left: 10px;"
					outcome="recipe" value="Annuler" />
			</div>
		</div>
	</h:form>

</ui:composition>
